﻿/*===================================================
* 类名称: LoginInfo
* 类描述:
* 创建人: Sc
* 创建时间: 2019/8/30 22:32:57
* 修改人: 
* 修改时间:
* 版本： @version 1.0
=====================================================*/
namespace OrderSystem.Common
{
    public static class LoginInfo
    {
        private static bool isLogined = false;

        private static int operatorID = -1;

        private static string operatorName = null;

        private static string loginName = null;

        private static string password = null;

        private static Role role = new Role();

        private static string hostIPAddress = null;

        private static string loginTime = null;

        public static bool IsLogined
        {
            get
            {
                return LoginInfo.isLogined;
            }
            set
            {
                LoginInfo.isLogined = value;
            }
        }

        public static int OperatorID
        {
            get
            {
                return LoginInfo.operatorID;
            }
            set
            {
                LoginInfo.operatorID = value;
            }
        }

        public static string OperatorName
        {
            get
            {
                return LoginInfo.operatorName;
            }
            set
            {
                LoginInfo.operatorName = value;
            }
        }

        public static string LoginName
        {
            get
            {
                return LoginInfo.loginName;
            }
            set
            {
                LoginInfo.loginName = value;
            }
        }

        public static string Password
        {
            get
            {
                return LoginInfo.password;
            }
            set
            {
                LoginInfo.password = value;
            }
        }

        public static Role Role
        {
            get
            {
                return LoginInfo.role;
            }
            set
            {
                LoginInfo.role = value;
            }
        }

        public static string HostIPAddress
        {
            get
            {
                return LoginInfo.hostIPAddress;
            }
            set
            {
                LoginInfo.hostIPAddress = value;
            }
        }

        public static string LoginTime
        {
            get
            {
                return LoginInfo.loginTime;
            }
            set
            {
                LoginInfo.loginTime = value;
            }
        }

        public static void Clear()
        {
            LoginInfo.isLogined = false;
            LoginInfo.operatorID = -1;
            LoginInfo.operatorName = null;
            LoginInfo.loginName = null;
            LoginInfo.password = null;
            LoginInfo.role.Clear();
            LoginInfo.hostIPAddress = null;
            LoginInfo.loginTime = null;
        }
    }
}
